package com.zzl.bonds.ticket.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.apidoc.constants.RequiredType;
import com.zzl.bonds.ticket.dto.ticketopen.CirculationEnterpriseDto;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 开立申请表
 *
 * @author sunpp
 * @date 2022-02-16 14:04:05
 */
@Data
@ApidocModel
@SuppressWarnings("javadoc")
public class TicketOpenAddDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 所属信息
     */
    @NotBlank(message = "开单企业id不能为空")
    @ApidocModelProperty(description = "开单企业id", example = "1", required = RequiredType.TRUE)
    private String openEnterpriseId;
    @NotBlank(message = "开单企业统一社会信用代码不能为空")
    @ApidocModelProperty(description = "开单企业统一社会信用代码", example = "ETRYUI34567", required = RequiredType.TRUE)
    private String openSocialCreditCode;
    @NotBlank(message = "收单企业id不能为空")
    @ApidocModelProperty(description = "收单企业id", example = "65", required = RequiredType.TRUE)
    private String receiveEnterpriseId;
    @NotBlank(message = "收单企业统一社会信用代码不能为空")
    @ApidocModelProperty(description = "收单企业统一社会信用代码", example = "1GDFHGJ6768", required = RequiredType.TRUE)
    private String receiveSocialCreditCode;
    @NotEmpty(message = "开单额度id不能为空")
    @ApidocModelProperty(description = "开单额度id", example = "1", required = RequiredType.TRUE)
    private String coreEnterpriseCreditId;
    /**
     * 凭证信息
     */
    @NotNull(message = "凭证金额不能为空")
    @ApidocModelProperty(description = "凭证金额", example = "10", required = RequiredType.TRUE)
    private Double ticketAmount;

    @NotNull(message = "开单日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "开单日期", validate = "yyyy-MM-dd", required = RequiredType.TRUE)
    private Date invoiceTime;
    @NotNull(message = "到期日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "到期日期", validate = "yyyy-MM-dd", required = RequiredType.TRUE)
    private Date expireTime;
    @NotNull(message = "是否指定流转企业不能为空")
    @ApidocModelProperty(description = "是否指定流转企业，0否 1 是", required = RequiredType.TRUE)
    private Integer circulationEnterpriseFlag;
    @ApidocModelProperty(description = "流转企业集合")
    private List<CirculationEnterpriseDto> circulationEnterpriseList;
    @NotNull(message = "付息方式不能为空")
    @ApidocModelProperty(description = "付息方式 ：1 融资方付息（默认）2 核心企业付息", example = "1", required = RequiredType.TRUE)
    private Integer paymentMode;

    @ApidocModelProperty(description = "备注")
    private String remark;

    @ApidocModelProperty(description = "基础交易合同号", example = "")
    private String contractNo;

    @ApidocModelProperty(description = "贸易合同文件集合", example = "")
    private List<TicketDataDto> proofList = new ArrayList<>();

    @ApidocModelProperty(description = "发票信息集合", example = "")
    private List<TicketDataDto> invoiceList = new ArrayList<>();

}
